﻿@{
    ViewBag.Title = "Login";
    Layout = null;
}
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
</head>

<link href="@TrialManagementTool.Helper.UrlHelper.alterContent("Content/bootstrap.min.css")" rel="stylesheet" />
<script src="@TrialManagementTool.Helper.UrlHelper.alterContent("Scripts/jQuery.min.js")"></script>
<script src="@TrialManagementTool.Helper.UrlHelper.alterContent("Scripts/js/bootstrap.min.js")"></script>
<script src="@TrialManagementTool.Helper.UrlHelper.alterContent("Scripts/layer/layer.js")"></script>
<script src="@TrialManagementTool.Helper.UrlHelper.alterContent("Scripts/urlHelper.js")"></script>

<div>
    <div class="logoArea">
        <img src="@TrialManagementTool.Helper.UrlHelper.alterContent("Images/DAS logo.png")" style="width:250px"/>
    </div>

    <div class="input-group" style="border-bottom:1px solid ;margin:auto;border-color:#ffffff;margin-top:50px">
        <img src="@TrialManagementTool.Helper.UrlHelper.alterContent("Images/user.png")" class="img" />
        <input style="" id="userid" placeholder="用户名" />
    </div>
    <div class="input-group" style="border-bottom:1px solid ;margin:auto;border-color:#ffffff;margin-top:30px">
        <img src="@TrialManagementTool.Helper.UrlHelper.alterContent("Images/psd.png")" class="img" />
        <input style="" type="password" id="userpsd" placeholder="密码" />
    </div>
    <div style="width:90%;margin:0 auto">
        <button type="button" class="btn btn-default" id="btnLogin" style="margin:auto;margin-top:20px;width:200px;margin-left:80px">登  陆</button>
    </div>
    <br />
    <span class="error" style="color:red;margin-left:100px;margin-bottom:40px"></span>

</div>
<script>
    $("#btnLogin").click(function () {
        if ($("#userid").val() == "" || $("#userpsd").val() == "") {
            $(".error").text("用户名和密码不能为空");
        } else {
            $.ajax({
                url: fixUrl("api/Common/AuthPromoterUser"),
                type: "post",
                data: { username: $("#userid").val() },
                beforesend: Loading(),
                success: function (data) {
                    if (data == "success") {
                        location.href = fixUrl("TrialMobile/TrialManagement")
                    } else {
                        layer.closeAll();
                        $(".error").text("验证失败,用户名或密码不正确");
                    }
                }
            })
        }

    })

    function Loading() {
        var o = layer.load(1, {
            shade: [0.1, '#fff'] //0.1透明度的白色背景
        });
        return o;
    }
</script>
<style>
    body {
        /*background-color: #506b40;*/
        background-image: url('@TrialManagementTool.Helper.UrlHelper.alterContent("Images/phone.jpg")');
    }

    input {
        color: #ffffff;
        font-size: 16px;
        border-color: transparent;
        background-color: transparent;
        height: 30px;
        border-color: transparent;
        text-align: center;
    }

        input:focus {
            outline: none;
            border-color: transparent;
            /*box-shadow: 0 0 10px #9ecaed;*/
        }

    .img {
        height: 30px;
        width: 30px;
    }

    .btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default:active:hover {
        background-color: #00985f !important;
        border: none !important;
        color: #ffffff !important;
    }

    .logoArea{
    padding-top: 12rem;
    text-align: center;
}
</style>
